package ldh.im.base.constant;

import ldh.common.mybatis.ValuedEnum;

public enum ImGroupType implements ValuedEnum<Byte> {
    chat((byte) 1, "聊天群"),
    temp((byte) 2, "临时群"),
    ;

    private Byte value;
    private String desc;

    private ImGroupType(Byte value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public ImGroupType getByValue(byte value) {
        for (ImGroupType groupStatus : ImGroupType.values()) {
            if (groupStatus.getValue().byteValue() == value) {
                return groupStatus;
            }
        }
        throw new RuntimeException("不支持此值， value=" + value);
    }

}
